﻿@model Tuple<List<Nutrapp.DBAL.Recipe>, List<Nutrapp.DBAL.Recipe>>
@{
    ViewBag.Title = "Result";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="row">
    <div id="searchresult">
        <div class="buttons">
            <button class="grid btn btn-success">Grid View</button>
            <button class="list btn btn-success">List View</button>
        </div>

        <div><h3>Strict Match: @Model.Item1.Count recipes </h3></div>
        @if (Model.Item1.Count > 0)
        {
            <ul class="list">
                @foreach (var item in Model.Item1)
                {
                    Model.Item2.Remove(item);

                    <li>
                        <img src="/Upload/RecipeImage/@Html.DisplayFor(modelItem => item.Picture)" alt="" height="100" width="120" />

                        <h2><a style="float:left; display:inline-grid" href="/Recipe/View/@Html.DisplayFor(modelItem => item.ID)">@Html.DisplayFor(modelItem => item.Name)</a></h2>
                    </li>
                }
            </ul>
        }
        else
        {
            <div>Nothing found by searching parameters(</div>
        }

        <div style="clear:both"><h3>Relevant Match: @Model.Item2.Count recipes </h3></div>

        @if (Model.Item2.Count > 0)
        {
            <ul class="list">
                @foreach (var item in Model.Item2)
                {
                    <li class="colour">
                        <img src="/Upload/RecipeImage/@Html.DisplayFor(modelItem => item.Picture)" alt="" height="100" width="120" />

                        <h2><a href="/Recipe/View/@Html.DisplayFor(modelItem => item.ID)">@Html.DisplayFor(modelItem => item.Name)</a></h2>
                    </li>
                }
            </ul>
        }
        else
        {
            <div>Nothing was found which suits you :(</div>
        }
    </div>
</div>
